system.html<extend name="desktop_default/template/user/base_user" />
<block name="area_header">
    <link rel="stylesheet" href="__CSS__/user/message/style.css">
</block>

<block name="area_top">

</block>
<block name="user_top">

</block>
<block name="main_content">
    <div class="message">
        <div class="user-tab">
            <a href="{:U('mengwu/user/message/t/system')}">系统通知</a>
            <a href="{:U('mengwu/user/message/t/comment')}">评论</a>
            <a class="selected" href="{:U('mengwu/user/message/t/focus')}">关注</a>
            <a href="{:U('mengwu/user/message/t/zan')}">赞</a>
            <a href="{:U('mengwu/user/message/t/sx')}">私信</a>
        </div>
        <div class="focus">
            <empty name="list">
                <div class="empty-list">没有任何人关注你哦~</div>
                <else/>
                <ul class="focus-list">
                    <volist name="list" id="vo">
                        <li>
                            <div class="head">
                                <img src="{$vo.head}">
                            </div>
                            <div class="content">
                                <div class="title">
                                    <em class="name">{$vo.nickname}</em>关注了我
                                </div>
                                <div class="date">{$vo.focus_time|date='Y-m-d H:i:s',###}</div>
                            </div>
                            <switch name="vo.is_focus_back">
                                <case value="0">
                                    <a class="btn btn-focus" data-uid="{$vo.uid}" href="javascript:void(0);"><i class="iconfont icon-plus"></i>关注</a>
                                </case>
                                <case value="1">
                                    <a class="btn btn-focused" data-uid="{$vo.uid}" href="javascript:void(0);">取消关注</a>
                                </case>
                                <default />
                            </switch>

                        </li>
                    </volist>
                </ul>
            </empty>
            {$show}
        </div>


    </div>

</block>
<block name="area_footer">
    <script type="text/javascript">
        function focus(ele,f,uid){
            var data = {
                focus_uid : uid,
                value : f ? 1 :0
            };
            var url = getBaseUrl() + '/mengwu/mengwuApi/user_focus';

            ele.addClass('disabled').attr('disabled','disabled');

            _post(url,jQuery.param(data),{data_back: function(data){
                if(data.status){
                    antd.message.success('操作成功！');
                    setTimeout(function(){window.location.reload()},500);
                }else{
                    if(typeof data.info.redirect !="undefined"){
                        antd.message.error(data.info.info);
                        setTimeout(function(){
                            window.location.href = data.info.redirect;
                        },1000);
                    }else{
                        antd.message.error('操作失败！');
                    }
                }
            }});
        }
        $('.btn-focus').click(function(){
            var uid = $(this).attr('data-uid');
            focus($(this),true,uid);
        });
        $('.btn-focused').click(function(){
            var uid = $(this).attr('data-uid');
            focus($(this),false,uid);
        });
    </script>

</block>
